package com.tn.task;


import com.tn.controller.alarm.common.model.camera.vo.CameraVO;
import com.tn.controller.alarm.common.model.truck.BindTruckDto;
import com.tn.dao.camera.ICameraDao;
import com.tn.dao.mbpdao.TruckinfoDao;
import com.tn.dao.weigh.IWeighDao;
import com.tn.service.truck.TruckService;
import com.tn.utils.JsonUtil;
import com.tn.utils.redis.RedisUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;


@Component
@Slf4j
public class CarTagTask {

    @Autowired
   private IWeighDao iWeighDao;

    //@Scheduled(cron = "0 0 0/1 * * ?")
    @Scheduled(cron = "0 0/5 * * * ?")
    public void executeRedisTask() {

        //查询所有的摄像头
        List<BindTruckDto> bindInfoLicenseList = iWeighDao.getBindInfoLicense();
        String s = JsonUtil.obj2String(bindInfoLicenseList);
        RedisUtils.setCacheObject("car_bind_tag_info",s);

    }
}
